<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class CreateUserMoneyLogTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('user_money_log', function(Blueprint $table)
		{
			$table->integer('id', true);
			$table->integer('user_id')->nullable()->comment('用户id');
			$table->integer('leader_id')->nullable()->comment('上级id');
			$table->integer('type')->nullable()->default(0)->comment('0 推广 1 团队');
			$table->integer('order_pay_id')->nullable()->comment('订单id');
			$table->timestamps();
			$table->decimal('price', 10)->nullable()->default(0.00)->comment('金钱 分为单位');
			$table->integer('status')->nullable()->default(0)->comment('0未结算 1已结算');
		});
	}


	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('user_money_log');
	}

}
